package com.designpattern.factory.single;

public class Connsumer {
    public static void main(String[] args) {
        Car car = new Wuling();
        Car car1 = new Tesla();

        car.name();
        car1.name();

        System.out.println("-------------------");
        //使用工厂创建

        Car car2 = CarFactory.getCar("五菱");
        car2.name();
        Car car3 = CarFactory.getCar("特斯拉");
        car3.name();
    }
}
